﻿using System;
using System.Configuration;
using DuLabs.Classic.Configuration;

namespace DuLabs.Classic.Configuration
{
    public class ClassElement : ConfigurationElement
    {
        [ConfigurationProperty("name", IsRequired = true, IsKey = true)]
        public string Name
        {
            get
            {
                return this["name"] as string;
            }
        }

        [ConfigurationProperty("enabled", DefaultValue = true)]
        public bool Enabled
        {
            get
            {
                return Convert.ToBoolean(this["enabled"]);
            }
        }

        [ConfigurationProperty("assembly", IsRequired = true)]
        public string Assembly
        {
            get
            {
                return this["assembly"] as string;
            }
        }

        [ConfigurationProperty("type", IsRequired = true)]
        public string Type
        {
            get
            {
                return this["type"] as string;
            }
        }

        [ConfigurationProperty("params")]
        public ParamElementCollection Params
        {
            get
            {
                return this["params"] as ParamElementCollection;
            }
        }
    }
}
